<?php

namespace app\yperp\command;


use app\yperp\common\Changhong;
use app\yperp\common\MgtChanghong;
use app\yperp\common\MyWebDriver;
use app\yperp\common\Redis;
use app\yperp\model\Supplier;
use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\Output;

class mgtpush extends Command
{
    protected function configure()
    {
        // 指令配置
        $this->setName('mgtpush')
            ->addArgument('type', Argument::OPTIONAL, "操作类型")
            ->setDescription('推送数据到长虹系统');
    }

    protected function execute(Input $input, Output $output)
    {
        // 指令输出
        $this->input = $input;

        $this->output = $output;
        if (!defined('PUBLIC_PATH')) {
            define('PUBLIC_PATH', '');
        }
        try {
            MgtChanghong::getInstance()->updateGoods('2');
        } catch (\Throwable $th) {
            //throw $th;
            dump($th->getMessage());
            dump($th->getTraceAsString());
        }
    }
}
